/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fpgrowth_demo;

import java.awt.Color;
import java.util.ArrayList;

/**
 *
 * @author TTIN
 */
public class Node {
    public int item;
    public int count;
    public int count_cpb=0;
    public int x;
    public int y;

    public Node parent;
    public ArrayList<Node> child= new ArrayList<Node>();
    public int flag_cpb;
    public int flag_cfptree;
    public int flag_cpb_selected;
    public Color color = Color.BLACK;

    /*public void draw(Graphics g, int mode)
    {


        g.setColor(color);
        g.fillRect(x, y, MainFrame.NODEWIDTH, MainFrame.NODEHEIGHT);
        g.drawString(String.valueOf(item)+":"+String.valueOf(count)+":"+String.valueOf(count_cpb)+":"+String.valueOf(flag), x, y);
        //g.drawRect(x, y, x+MainFrame.NODEWIDTH, y+ MainFrame.NODEHEIGHT);
        for (Node n:child)
        {
            n.draw(g, mode);
            if ((mode==1) && (n.color==color))
                g.setColor(color);
            else
                g.setColor(Color.BLACK);
            g.drawLine(n.x+(int)MainFrame.NODEWIDTH/2, n.y, x+(int)MainFrame.NODEWIDTH/2, y+ MainFrame.NODEHEIGHT);
        }
    }

    @Override
    public Node clone()
    {
        Node n = new Node();
        n.item = item;
        n.flag = flag;
        n.count = count;
        n.count_cpb = count_cpb;
        n.color = color;
        n.x = x;
        n.y = y;
        if (!child.isEmpty())
            for (Node subnode:child)
            {
                Node snc = subnode.clone();
                snc.parent = n;
                n.child.add(snc);                
            }
        return n;
    }*/
}
